<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ include file="/Pages/Jsp/Common/header.jsp"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<html>
	<head>
		<link type="text/css"
			href="<%=request.getContextPath()%>/Pages/Css/main.css"
			rel="stylesheet" />
		<link type="text/css"
			href="<%=request.getContextPath()%>/Pages/Css/forum/topicDetails.css"
			rel="stylesheet" />
		<script language="javascript" type="text/javascript"
			src="<%=request.getContextPath()%>/Pages/Js/topicDetails.js"></script>
					<script type="text/javascript"
			src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"></script>
		<title>Forum-EKMS</title>
	</head>
	<body>
		<div class="out_box">
			<div class="site_map">
				<span><a href="#">home</a> </span><span class="path_image">&gt;&gt;</span><span><a
					href="#" class="a2">forum</a> </span><span class="path_image">&gt;&gt;</span><span><a
					href="#" class="a3">forum name</a> </span>
			</div>
			<form name="topicDetailsForm" method="post">
				<div class="topic_details">
					<div class="topic_header">
						<h1 class="topic_subject">
							${topic.subject}
						</h1>
						<div>
							 <input type="text" style="display: none;"
									value="${topic.id}" name="topicId" /> <a href="#" class="author_name">${topic.author.userName}</a>
							<span class="date">${topic.createDate}</span>
						</div>
					</div>
					<div class="topic_body">
						${topic.content}
					</div>
				</div>

				<logic:present name="replyList">
					<div class="reply_list">
						<logic:iterate id="reply" name="replyList"
							type="com.capgemini.fs.app.ekms.model.Reply">
							<div class="reply_container">
								<div class="w1">
									<div class="w2">
										<div class="w3">
											<div class="w4">
												<h3 class="title">${reply.subject}</h3>
												<div class="author"><a><%=session.getAttribute("username")%></a><span><%=new Date().toString()%></span></div>
												<div class="content"><p>${reply.content}</p></div>
											</div>
										</div>
									</div>
								</div>
							</div>
		
						</logic:iterate>

						<div id="pageLinks">
							<a href="#" onClick="goToFirstPage()"> First Page </a>
							&nbsp;&nbsp;
							<a href="#" onClick="goToPreviousPage()"> Previous Page </a>
							&nbsp;&nbsp;
							<input readonly="readonly" class="span-2" id="currentPage"
								value="${totalPage}" />
							&nbsp;&nbsp;
							<a href="#" onclick="goToNextPage()"> Next Page </a> &nbsp;&nbsp;
							<a href="#" onClick="goToLastPage()"> Last Page </a> &nbsp;&nbsp;
							<input class="span-1" name="targetPage" id="pageNum" />
							<input style="display:none" name="nowPage" value="${nowPage}"></input>
							<input style="display:none" name="totalPage"
								value="${totalPageNum}"></input>
							<a href="#" onclick="goToPage();"/>Go To</a>

						</div>
					</div>
				</logic:present>

				<div>
					<div class="post_reply_title">
						Post Reply
						<div class="br"></div>
					</div>
					<div class="subject_input">
						Subject:
						<input class="subject_text_input" type="text" name="replySubject" />
					</div>
					<div>
						<div>
							<textarea id="editor1" name="replyContent">
							
							</textarea>
							<script type="text/javascript">
	CKEDITOR.replace('editor1', {
		toolbar : 'Basic'
	});
</script>
						</div>

					</div>

					<div class="new_reply_submit">
						
							<a title="Post Reply" id="create_reply_link"
								onclick=
	submitReply();
><span class="left"><span
									class="creat_reply_link_btn">Post Reply</span> </span> </a>
						</div>
				</div>


				<input id="sortType" name="sortType" style="display: none;"
					value="${sortType}"></input>
				<input id="sortOrder" name="sortOrder" style="display: none;"
					value="${sortOrder}"></input>
				<div class="clear"></div>
			</form>
		</div>
		<jsp:include page="/Pages/Jsp/Common/footer.jsp"></jsp:include>
	</body>
</html>